/*
 * Project: matm-commons-test
 * 
 * Created: 10-02-2011
 *
 * $HeadURL$
 * $Id$
 *
 * Copyright (c) 2011 First Data Polska S.A.. All rights reserved.
 */
package pl.com.britenet.myredmine.commons.utils;

import java.sql.Types;

import org.dbunit.dataset.datatype.DataType;
import org.dbunit.dataset.datatype.DataTypeException;
import org.dbunit.dataset.datatype.DefaultDataTypeFactory;

/**
 * Data type that resolves BOOLEAN type conversion bug in DBUnit tests.
 * 
 * @author <a href="mailto:marcin.maliszewski@britenet.com.pl">Marcin Maliszewski</a>
 * 
 */
public class HsqlDataTypeFactory extends DefaultDataTypeFactory {

    /** {@inheritDoc} */
    @Override
    public DataType createDataType(int sqlType, String sqlTypeName) throws DataTypeException {
        if (sqlType == Types.BOOLEAN) {
            return DataType.BOOLEAN;
        }

        return super.createDataType(sqlType, sqlTypeName);
    }
}